<#-- 导入模版定义文件-->
<#include "../template/template_editPage.ftl">
<@edit title="商户审核">

<body class="input">

<script type="text/javascript">
    $().ready(function () {

        var $validateErrorContainer = $("#validateErrorContainer");
        var $validateErrorLabelContainer = $("#validateErrorContainer ul");
        var $validateForm = $("#inputForm");
        var $tab = $("#tab");

        // Tab效果
        $tab.tabs(".tabContent", {
            tabs:"input"
        });

        // 表单验证
        $validateForm.validate({
            errorContainer:$validateErrorContainer,
            errorLabelContainer:$validateErrorLabelContainer,
            wrapper:"li",
            errorClass:"validateError",
            ignoreTitle:true,
            rules:{

            },
            messages:{
 
            },
            submitHandler:function (form) {
                //$(form).find(":submit").attr("disabled", true);
                form.submit();
            }
        });
        <#if actionErrors?? && (actionErrors?size > 0)>
            $.messager.show("提示信息", "<#list errorMessages as list>${list}<br></#list>", 2000);
        </#if>
    });

function checkTrader(){
	var check = $('input[name="trader.traderStatus"]').filter(':checked');
	
	if(check.length == 0){
		alert('请选择审核结果') ;
		return ;
	}
	$.post(
		'${web_base}/ekhui/trader!check.htm' ,
		{"trader.traderId" : $('#traderId').val() , "trader.traderStatus" : check.val()} ,
		function(data){
			alert(data) ;
			if(data == 'true'){
				alert('审核完成') ;
			}else if(data == 'false'){
				alert('审核失败') ;
			}
			window.location.href="${web_base}/ekhui/trader!list.htm" ;
		}
	);
}
</script>

<div class="body">
<div class="inputBar">
    <h1><span class="icon">&nbsp;</span>商户审核</h1>
</div>
<div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
    <div class="validateErrorTitle">以下信息填写有误,请重新填写</div>
    <ul></ul>
</div>
<form id="inputForm" class="validate"
      > 
    <ul class="tab">
        <li>
            <input type="button" value="商户基本信息" hidefocus="true"/>
        </li>
    </ul>
    <input type="hidden" id="traderId" name="trader.traderId" class="formText" value="${(trader.traderId)!}"/>
    <table class="inputTable tabContent">
        <tr>
            <th>
                单位名称：
            </th>
            <td>
                    ${(trader.traderName)!}
            </td>
        </tr>
        <tr>
            <th>
                负责人:
            </th>
            <td>
                   ${(trader.legelName)!}
                
            </td>
        </tr>
        <tr>
            <th>
                身份证
            </th>
            <td>
                   ${trader.legelCard!''}
            </td>
        </tr>

        <tr>
            <th>
               手机号码
            </th>
            <td>


                   ${trader.mobile!''}
            </td>
        </tr>

        <tr>
            <th>
                固定电话：
            </th>
            <td>
             	${trader.telephone!''}
            </td>
        </tr>
        
        <tr>
            <th>
                省：
            </th>
            <td>
             ${trader.provinceName!''}
            </td>
        </tr>
        
            <tr>
            <th>
                市：
            </th>
            <td>
           ${trader.cityName!''}
            </td>
        </tr>
        
     	<tr>
            <th>
                区/县：
            </th>
            <td>
           ${trader.areaName!''}
            </td>
        </tr> 
        
        <tr>
            <th>
                联系地址：
            </th>
            <td>
             	${trader.address!''}
            </td>
        </tr>
        
        <tr>
            <th>
                商户类型：
            </th>
            <td>
                    <select name="trader.traderType" class="formText {required: true}">
                        <option value="">请选择...</option>
                        <option value="3" <#if trader.traderType=="3">selected="selected"</#if>>
                          	  销售商
                        </option>
                    </select>
            </td>
        </tr>
        
                <tr>
            <th>
                审核类型：
            </th>
            <td>
                <input type="radio" name="trader.traderStatus" value="1">通过
                <input type="radio" name="trader.traderStatus" value="-1">不通过
            </td>
        </tr>
    </table>
    <div class="buttonArea">
        <input type="button" class="formButton" value="审 核" onclick="checkTrader()" />&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" class="formButton" onclick="window.history.back(); return false;" value="返  回"
               hidefocus="true"/>
    </div>
</form>
</div>
</body>
</@edit>
